function getHTTPObject() 
{
	var xmlhttp; 
  	if(window.XMLHttpRequest)
  	{
    	xmlhttp = new XMLHttpRequest();
  	}
  	else if (window.ActiveXObject)
  	{
    	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    	if (!xmlhttp)
		{
        	xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    	}   
	}
  	return xmlhttp;
}

function showhabit()
{
	var httpQuote = getHTTPObject();
	var num_habit=window.document.getElementById('num_habit').value;
	var url = "show_unhabit.php";
	var param = "num_habit="+num_habit;
	httpQuote.open("POST",url,true);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (num_habit==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('show_unhabit').innerHTML=httpQuote.responseText;
			//if(document.getElementById('c1').checked && !(document.getElementById('file').value==""))
			if(document.getElementById('c1').checked)
			{
				var check_val = window.document.getElementById('c1').value;
				//alert(check_val);
				for(i=1; i<=num_habit; i++)
				{
					//alert(num_habit);
					document.getElementById('un_longitude'+i).disabled=true;
					document.getElementById('un_latitude'+i).disabled=true;
				}
			}
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function showglrs()
{
	var httpQuote = getHTTPObject();
	var num_glrs=window.document.getElementById('num_glrs').value;
	var check=window.document.getElementById('check_value').value;
	var url = "showglrs.php";
	var param = "num_glrs="+num_glrs;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(check);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (num_glrs==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('show_glrs').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=num_glrs; i++)
				{
					document.getElementById('glrs_longitude'+i).disabled=true;
					document.getElementById('glrs_latitude'+i).disabled=true;
				}
			}	
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function showglsr()
{
	var httpQuote = getHTTPObject();
	var num_glsr=window.document.getElementById('num_glsr').value;
	var check=window.document.getElementById('check_value').value;
	var url = "showglsr.php";
	var param = "num_glsr="+num_glsr;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (num_glsr==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('show_glsr').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=num_glsr; i++)
				{
					document.getElementById('glsr_longitude'+i).disabled=true;
					document.getElementById('glsr_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function showpsp()
{
	var httpQuote = getHTTPObject();
	var psp_total=window.document.getElementById('psp_total').value;
	var check=window.document.getElementById('check_value').value;
	var url = "showpsp_detail.php";
	var param = "psp_total="+psp_total;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (psp_total==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('show_psp').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=psp_total; i++)
				{
					document.getElementById('psp_longitude'+i).disabled=true;
					document.getElementById('psp_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_subm()
{
	var httpQuote = getHTTPObject();
	var total_sub_pump=window.document.getElementById('total_sub_pump').value;
	var check=window.document.getElementById('check_value').value;
	//alert(cwr_total);
	var url = "q3_subm.php";
	var param = "total_sub_pump="+total_sub_pump;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (total_sub_pump==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('subm').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=total_sub_pump; i++)
				{
					document.getElementById('sub_longitude'+i).disabled=true;
					document.getElementById('sub_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_mono()
{
	var httpQuote = getHTTPObject();
	var total_mono_block_pump=window.document.getElementById('total_mono_block_pump').value;
	var check=window.document.getElementById('check_value').value;
	//alert(cwr_total);
	var url = "q3_mono.php";
	var param = "total_mono_block_pump="+total_mono_block_pump;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (total_mono_block_pump==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('mono').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=total_mono_block_pump; i++)
				{
					document.getElementById('mono_longitude'+i).disabled=true;
					document.getElementById('mono_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_centi()
{
	var httpQuote = getHTTPObject();
	var total_centrifugal_pump=window.document.getElementById('total_centrifugal_pump').value;
	var check=window.document.getElementById('check_value').value;
	//alert(cwr_total);
	var url = "q3_centi.php";
	var param = "total_centrifugal_pump="+total_centrifugal_pump;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (total_centrifugal_pump==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('centi').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=total_centrifugal_pump; i++)
				{
					document.getElementById('centi_longitude'+i).disabled=true;
					document.getElementById('centi_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_sp()
{
	var httpQuote = getHTTPObject();
	var total_single_phase_pump=window.document.getElementById('total_single_phase_pump').value;
	var check=window.document.getElementById('check_value').value;
	//alert(cwr_total);
	var url = "q3_sp.php";
	var param = "total_single_phase_pump="+total_single_phase_pump;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (total_single_phase_pump==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('sp').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=total_single_phase_pump; i++)
				{
					document.getElementById('sp_longitude'+i).disabled=true;
					document.getElementById('sp_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_cwr_cap()
{
	var httpQuote = getHTTPObject();
	var num_cwr=window.document.getElementById('num_cwr').value;
	var check=window.document.getElementById('check_value').value;
	//alert(cwr_total);
	var url = "q3_cwr.php";
	var param = "num_cwr="+num_cwr;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (num_cwr==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('cwr_cap').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=num_cwr; i++)
				{
					document.getElementById('cwr_longitude'+i).disabled=true;
					document.getElementById('cwr_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

/*function show_glsr_cap()
{
	var httpQuote = getHTTPObject();
	var num_glsr=window.document.getElementById('num_glsr').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_glsr.php";
	var param = "num_glsr="+num_glsr;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (num_glsr==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('glsr_cap').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=num_glsr; i++)
				{
					document.getElementById('glsr_longitude'+i).disabled=true;
					document.getElementById('glsr_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}
function show_glr_cap()
{
	var httpQuote = getHTTPObject();
	var num_glr=window.document.getElementById('num_glr').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_glr.php";
	var param = "num_glr="+num_glr;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (num_glr==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('glr_cap').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=num_glr; i++)
				{
					document.getElementById('glr_longitude'+i).disabled=true;
					document.getElementById('glr_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}*/

function show_ohsr_cap()
{
	var httpQuote = getHTTPObject();
	var num_ohsr=window.document.getElementById('num_ohsr').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_ohsr.php";
	var param = "num_ohsr="+num_ohsr;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (num_ohsr==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('ohsr_cap').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=num_ohsr; i++)
				{
					document.getElementById('ohsr_longitude'+i).disabled=true;
					document.getElementById('ohsr_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_baw()
{
	var httpQuote = getHTTPObject();
	var baw_no=window.document.getElementById('baw_no').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_baw.php";
	var param = "baw_no="+baw_no;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (baw_no==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('bawarie').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=baw_no; i++)
				{
					document.getElementById('baw_longitude'+i).disabled=true;
					document.getElementById('baw_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_well()
{
	var httpQuote = getHTTPObject();
	var well_no=window.document.getElementById('well_no').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_well.php";
	var param = "well_no="+well_no;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (well_no==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('well').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=well_no; i++)
				{
					document.getElementById('well_longitude'+i).disabled=true;
					document.getElementById('well_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_pub_tankas()
{
	var httpQuote = getHTTPObject();
	var tanka_no=window.document.getElementById('tanka_no').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_pub_tanka.php";
	var param = "tanka_no="+tanka_no;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (tanka_no==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('public_tanka').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=tanka_no; i++)
				{
					document.getElementById('tanka_longitude'+i).disabled=true;
					document.getElementById('tanka_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_house_takas()
{
	var httpQuote = getHTTPObject();
	var house_tanka_no=window.document.getElementById('house_tanka_no').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_house_tanka.php";
	var param = "house_tanka_no="+house_tanka_no;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (house_tanka_no==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('house_tanka').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=house_tanka_no; i++)
				{
					document.getElementById('htanka_longitude'+i).disabled=true;
					document.getElementById('htanka_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_ponds_pucca()
{
	var httpQuote = getHTTPObject();
	var pucca_no=window.document.getElementById('pucca_no').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_pond_pucca.php";
	var param = "pucca_no="+pucca_no;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (pucca_no==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('pond_pucca').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=pucca_no; i++)
				{
					document.getElementById('pucca_longitude'+i).disabled=true;
					document.getElementById('pucca_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_ponds_kachha()
{
	var httpQuote = getHTTPObject();
	var kachha_no=window.document.getElementById('kachha_no').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_pond_kachha.php";
	var param = "kachha_no="+kachha_no;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (kachha_no==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('pond_kachha').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=kachha_no; i++)
				{
					document.getElementById('kachha_longitude'+i).disabled=true;
					document.getElementById('kachha_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}

function show_canal()
{
	var httpQuote = getHTTPObject();
	var canal_no=window.document.getElementById('canal_no').value;
	var check=window.document.getElementById('check_value').value;
	var url = "q3_canal.php";
	var param = "canal_no="+canal_no;
   	httpQuote.open("POST",url,true);
	//alert(param);
	//alert(httpQuote.onreadystatechange);
	httpQuote.onreadystatechange = function() {
	//alert(httpQuote.readyState);
	if(httpQuote.readyState==4)
	{
	    if ((httpQuote.status==200) || (canal_no==0))
		{
			//alert(httpQuote.responseText);
			document.getElementById('canal').innerHTML=httpQuote.responseText;
			if(check=="kml_file")
			{
				for(var i=1; i<=canal_no; i++)
				{
					document.getElementById('canal_longitude'+i).disabled=true;
					document.getElementById('canal_latitude'+i).disabled=true;
				}
			}	
			//confirm("Do you want to save!");
		}
		else
		{
			alert("An error has occured making the request");
		}
	}
	}
	httpQuote.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	httpQuote.send(param);	
}